/**
 * @Author: 魏巍
 * @Date:   2018-09-26T02:07:16+08:00
 * @Email:  524314430@qq.com
 * @Filename: create.js
 * @Last modified by:   魏巍
 * @Last modified time: 2018-09-26T02:28:11+08:00
 * @Copyright: free
 */

require('dotenv').config()
const jwt = require('jsonwebtoken')

module.exports = user => {
  const token = jwt.sign({
      id: user.id,
      secret: user.app_secret
    },
    process.env.JWT_SECRET, {
      expiresIn: 3600
    })
}
